//
//  ZLViewController.m
//  ZLNotification
//
//  Created by zzl on 07/07/2023.
//  Copyright (c) 2023 zzl. All rights reserved.
//

#import "ZLViewController.h"
#import <ZLNotification/ZLNotification.h>

@interface ZLViewController ()

@end

@implementation ZLViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [ZLNotification addNotification:@"ZLViewController" name:@"testNotif" complete:^(NSNotification * _Nonnull notification) {
        NSLog(@"ZLViewController 收到通知: %@", notification);
    }];
}
- (IBAction)testNotif:(id)sender {
    [ZLNotification postNotification:@"testNotif" object:@"testNotif"];
}
- (IBAction)removeDelegateNotif:(id)sender {
    [ZLNotification removeNotification:@"application" name:@"testNotif"];
}
- (IBAction)removeVCNotif:(id)sender {
    [ZLNotification removeNotification:@"ZLViewController" name:@"testNotif"];
}
- (IBAction)removeAllNotif:(id)sender {
    //移除所有通知
    [ZLNotification removeAllNotification];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
